package com.zbcz.crm.bean

import android.os.Parcel
import android.os.Parcelable

// 定义记录数据模型
class ProjectBean(
    var actualAmount: String? = "",       // 实际金额
    var createBy: String? = "",           // 创建人
    var createTime: String? = "",         // 创建时间
    var customerId: String? = "",         // 客户ID
    var customerName: String? = "",       // 客户名称
    var estimatedAmount: String? = "",    // 预估金额
    var id: String? = "",                 // 记录ID
    var leader: String? = "",             // 负责人
    var leaderId: String? = "",           // 负责人ID
    var midArchive: String? = "",         // 中档案
    var midArchiveReason: String? = "",   // 中档案原因
    var projectName: String? = "",        // 项目名称
    var projectStatus: String? = "",      // 项目状态
    var projectType: String? = "",        // 项目类型
    var sysOrgCode: String? = "",         // 组织编码
    var updateBy: String? = "",           // 更新人
    var updateTime: String? = ""          // 更新时间
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    // 次要构造方法，只传递 projectName 和 projectType，其他字段设置为空字符串
    constructor(projectName: String?, projectType: String?) : this() {
        this.projectName = projectName
        this.projectType = projectType
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(actualAmount)
        parcel.writeString(createBy)
        parcel.writeString(createTime)
        parcel.writeString(customerId)
        parcel.writeString(customerName)
        parcel.writeString(estimatedAmount)
        parcel.writeString(id)
        parcel.writeString(leader)
        parcel.writeString(leaderId)
        parcel.writeString(midArchive)
        parcel.writeString(midArchiveReason)
        parcel.writeString(projectName)
        parcel.writeString(projectStatus)
        parcel.writeString(projectType)
        parcel.writeString(sysOrgCode)
        parcel.writeString(updateBy)
        parcel.writeString(updateTime)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ProjectBean> {
        override fun createFromParcel(parcel: Parcel): ProjectBean {
            return ProjectBean(parcel)
        }

        override fun newArray(size: Int): Array<ProjectBean?> {
            return arrayOfNulls(size)
        }
    }
}
